using System;
using System.Collections.Generic;
using System.Text;

namespace Agro2DPipeline
{
    /// <summary>
    /// Base class for collections of properties and class type name.
    /// </summary>
    public class IPropertyInfo
    {
        /// <summary>
        /// Class name of object instance.
        /// </summary>
        public string TypeName = string.Empty;
        /// <summary>
        /// Properties and their values.
        /// </summary>
        public IDictionary<string, string> Properties = new Dictionary<string, string>();
    }

    /// <summary>
    /// Contains sprite properties and their values.
    /// </summary>
    public class SpriteInfo : IPropertyInfo
    {
        /// <summary>
        /// Sprite Properties and their values.
        /// </summary>
        public IDictionary<string, string> SpriteProperties = new Dictionary<string, string>();
        /// <summary>
        /// Collision Properties and their values.
        /// </summary>
        public IDictionary<string, string> CollisionProperties = new Dictionary<string, string>();
        /// <summary>
        /// Animation.
        /// </summary>
        public AnimationInfo Animation = null;
        public bool HasAnimation = false;
    }

    /// <summary>
    /// Contains information to load animations. These will be added to a sprites ActionAnimation.
    /// </summary>
    public class AnimationInfo : IPropertyInfo
    {
        /// <summary>
        /// Name of AnimationContainer, can be empty for single animations.
        /// </summary>
        //public string AnimationContainer = string.Empty;
        public List<AnimationInfo> NestedAnimations = new List<AnimationInfo>();
    }

    /// <summary>
    /// Combines the name of level, as well as properties and their values.
    /// </summary>
    public class LevelInfo : IPropertyInfo
    {
        /// <summary>
        /// Contains the properties for sprites and animations.
        /// </summary>
        public SpriteTemplateInfo SpriteInfo = new SpriteTemplateInfo();
        public List<SpawnPointInfo> SpawnPointInfoList = new List<SpawnPointInfo>();
    }

    /// <summary>
    /// List of sprites.
    /// </summary>
    public class SpriteTemplateInfo
    {
        /// <summary>
        /// Contains the properties for sprites.
        /// </summary>
        public List<SpriteInfo> Sprites = new List<SpriteInfo>();
    }

    public class SpawnPointInfo : IPropertyInfo
    {
    }

    /// <summary>
    /// Game proprerties.
    /// </summary>
    public class GameInfo
    {
        /// <summary>
        /// List of available Collision groups; their integer identifer (enum) 
        /// and their string identifier.
        /// </summary>
        public IDictionary<string, string> CollisionGroups = new Dictionary<string, string>();
        public List<string> LevelFileNames = new List<string>();
        public List<string> LevelNames = new List<string>();
        public string SpriteTemplateFile;
    }
}
